package tangjl.timer.task;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.log4j.Logger;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AnnotationTask {
	private Logger logger = Logger.getLogger(getClass());

	@Scheduled(cron = "0/5 * * * * ?")
	public void name() {
		if (logger.isInfoEnabled()) {
			logger.info("执行定时任务:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
		}
	}
}
